export default {
    data () {
        return {
            drawer: {
                visible: false,
                direction: 'rtl'
            },
            pagination: {
                pageOn: 1,
                pageSize: 10,
                total: 0,
            },
            sorting: {
                orderBy: 'createTime',
                sort: 'desc'
            },
            // 表格相关
            table: {
                loading: false,
                data: [],
                selectionRows: [],
            },
        }
    },
    methods: {
        // 展示查询项
        showSearch () {
            this.drawer.visible = true
        },
        // 重置
        reset () {
            if (this.$refs.queryForm) {
                this.$refs.queryForm.resetFields()
            }
            this.pagination.pageOn = 1
            this.page('reset')
        },
        handleRowClick (row) {
            this.$refs.table.toggleRowSelection(row)
        },
        // 表格选中事件
        handleSelectionChange (selection) {
            this.table.selectionRows = selection
        },
        // 关闭查询抽屉的方法
        queryClose (done) {
            done()
            const action = 'queryClose'
            this.page({action})
        },
    },
}
